package com.simon.hse.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.simon.hse.R;
import com.simon.hse.activity.contractor.ContractorManagerActivity;
import com.simon.hse.activity.danger.DangerManagerActivity;
import com.simon.hse.activity.danger.KnowledgeManagerActivity;
import com.simon.hse.activity.education.EducationManagerActivity;
import com.simon.hse.activity.law.LawManageActivity;
import com.simon.hse.activity.risk.RiskManagerActivity;
import com.simon.hse.activity.safe.SafeManagerActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;

/**
 * 主页面
 */
@ContentView(R.layout.fragment_home)
public class HomeFragment extends BaseFragment {
    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

    }

    @Event(value = {R.id.ll_function_1, R.id.ll_function_2, R.id.ll_function_3, R.id.ll_function_4, R.id.ll_function_5, R.id.ll_function_6, R.id.ll_function_7})
    private void clickFunction(View view) {
        Intent intent = new Intent();
        switch (view.getId()) {
            case R.id.ll_function_1:
                intent.setClass(getContext(), LawManageActivity.class);
                break;
            case R.id.ll_function_2:
                intent.setClass(getContext(), DangerManagerActivity.class);
                break;
            case R.id.ll_function_3:
                intent.setClass(getContext(), ContractorManagerActivity.class);
                break;
            case R.id.ll_function_4:
                intent.setClass(getContext(), EducationManagerActivity.class);
                break;
            case R.id.ll_function_5:
                intent.setClass(getContext(), SafeManagerActivity.class);
                break;
            case R.id.ll_function_6:
                intent.setClass(getContext(), RiskManagerActivity.class);
                break;
            case R.id.ll_function_7:
                intent.setClass(getContext(), KnowledgeManagerActivity.class);
                break;
        }
        startActivity(intent);
    }
}
